(eshell-ls-files): List one per line in a pipeline. (Bug#699)
authorGlenn Morris <rgm@gnu.org>
Fri, 15 Aug 2008 06:52:23 +0000 (06:52 +0000)
committerGlenn Morris <rgm@gnu.org>
Fri, 15 Aug 2008 06:52:23 +0000 (06:52 +0000)
lisp/eshell/em-ls.el

index a31fb26b5f190c8a1bcf64f01d6c06df01d96c16..bdfe66420fb23ae82b4c93360e063c469ade64fc 100644 (file)
@@ -638,7 +638,12 @@ In Eshell's implementation of ls, ENTRIES is always reversed."
   "Output a list of FILES.
 Each member of FILES is either a string or a cons cell of the form
 \(FILE .  ATTRS)."
-  (if (memq listing-style '(long-listing single-column))
+  ;; Mimic behavior of coreutils ls, which lists a single file per
+  ;; line when output is not a tty.  Exceptions: if -x was supplied.
+  ;; Not really the same since not testing output destination.
+  (if (or (and eshell-in-pipeline-p
+              (not (eq listing-style 'by-lines)))
+         (memq listing-style '(long-listing single-column)))
       (eshell-for file files
        (if file
            (eshell-ls-file file size-width copy-fileinfo)))